package net.qhzw.vip.qiyu.service;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import net.qhzw.vip.qiyu.dto.OrderCountData;
import net.qhzw.vip.qiyu.dto.ShopCartOrderMergerDto;
import net.qhzw.vip.qiyu.entity.Order;
import net.qhzw.vip.qiyu.param.OrderParam;

import java.util.Date;
import java.util.List;

public interface OrderService extends IService<Order> {

    Order getOrderByOrderNumber(String orderNumber);

    ShopCartOrderMergerDto putConfirmOrderCache(Long userId,
                                                ShopCartOrderMergerDto shopCartOrderMergerDto);

    ShopCartOrderMergerDto getConfirmOrderCache(Long userId);

    void removeConfirmOrderCache(Long userId);

    List<Order> submit(Long userId, ShopCartOrderMergerDto mergerOrder);

    void delivery(Order order);

    List<Order> listOrderAndOrderItems(Integer orderStatus, DateTime lessThanUpdateTime);

    void cancelOrders(List<Order> orders, Byte status);

    void confirmOrder(List<Order> orders);

    List<Order> listOrdersDetialByOrder(String orderNumber, Integer shippingType, Integer status, Integer isPayed, Date startTime, Date endTime);

    IPage<Order> pageOrdersDetialByOrderParam(Page<Order> page, OrderParam orderParam);

    void deleteOrders(List<Order> orders);

    OrderCountData getOrderCount(Long userId);
}
